//
//  didRepayTableViewCell.m
//  OneCreditTreasure
//
//  Created by iOS Grouper on 16/8/30.
//
//

#import "didRepayTableViewCell.h"

@interface didRepayTableViewCell (){
    UIView *hengLine;
}
@property (nonatomic,strong)UILabel *yingHuanL;
@property (nonatomic,strong)UILabel *zhuangTaiL;
@property (nonatomic,strong)UILabel *mouthNumberL;
@property (nonatomic,strong)UILabel *dataL;
@property (nonatomic,strong)UILabel *mouthYuanQuanL;
@end

@implementation didRepayTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self creatView];
    }
    
    return self;
}
- (void)creatView{
    
    _mouthYuanQuanL = [UILabel new];
    [self.contentView addSubview:_mouthYuanQuanL];
    [_mouthYuanQuanL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(0 * AUTO_HEIGHT);
        make.left.mas_equalTo(30 * AUTO_WIDTH);
        make.size.mas_equalTo(CGSizeMake(30 * AUTO_WIDTH, 30 * AUTO_HEIGHT));
        
        
    }];
    _mouthYuanQuanL.layer.cornerRadius = 15 * AUTO_HEIGHT;
    _mouthYuanQuanL.layer.masksToBounds = YES;
    _mouthYuanQuanL.layer.borderWidth = 1.2;
    _mouthYuanQuanL.layer.borderColor = [UIColor lightGrayColor].CGColor;
    
    
    //竖线
    UIView *Sline = [UIView new];
    [self.contentView addSubview:Sline];
    [Sline mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_mouthYuanQuanL.mas_bottom);
        make.left.mas_equalTo(_mouthYuanQuanL.mas_centerXWithinMargins);
        make.width.mas_equalTo(1);
        make.bottom.mas_equalTo(self.contentView);
        
    }];
    Sline.backgroundColor = [UIColor blackColor];
    
    
    _backView = [UILabel new];
    [self.contentView addSubview:_backView];
    [_backView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_mouthYuanQuanL.mas_centerYWithinMargins);
        make.left.mas_equalTo(_mouthYuanQuanL.mas_right).offset(30 * AUTO_WIDTH);
        make.width.mas_equalTo(200 * AUTO_WIDTH);
        make.height.mas_equalTo(self.contentView).multipliedBy(0.7);
        
    }];
//    _backView.backgroundColor = [UIColor redColor];
    _backView.layer.borderWidth = 1;
    _backView.layer.borderColor = [UIColor lightGrayColor].CGColor;
    
    
    _yingHuanL = [UILabel new];
    [self.backView addSubview:_yingHuanL];
    [_yingHuanL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_backView.mas_top).offset(7 * AUTO_HEIGHT);
        make.left.mas_equalTo(8 * AUTO_WIDTH);
        make.height.mas_equalTo(15 * AUTO_HEIGHT);
        
        
    }];
    _yingHuanL.text = @"应还: 18080元";
    _yingHuanL.textColor = ZITI;
    _yingHuanL.font = [UIFont fontWithName:ZIXING size:11 * AUTO_HEIGHT];

    
    _zhuangTaiL = [UILabel new];
    [_backView addSubview:_zhuangTaiL];
    [_zhuangTaiL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_yingHuanL.mas_bottom).offset(5 * AUTO_HEIGHT);
        make.left.height.mas_equalTo(_yingHuanL);
        
    }];
    _zhuangTaiL.textColor = ZITI;
    _zhuangTaiL.text = @"状态: 已还";
    _zhuangTaiL.font = [UIFont fontWithName:ZIXING size:11 * AUTO_HEIGHT];
    
    
    _mouthNumberL = [UILabel new];
    [_backView addSubview:_mouthNumberL];
    [_mouthNumberL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_zhuangTaiL.mas_bottom).offset(5 * AUTO_HEIGHT);
        make.left.height.mas_equalTo(_zhuangTaiL);
        
        
    }];
    _mouthNumberL.textColor = ZITI;
    _mouthNumberL.text = @"期数: 第3期(共26期)";
    _mouthNumberL.font = [UIFont fontWithName:ZIXING size:11 * AUTO_HEIGHT];
    
    
    _dataL= [UILabel new];
    [_backView addSubview:_dataL];
    [_dataL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_mouthNumberL.mas_bottom).offset(5 * AUTO_HEIGHT);
        make.left.height.mas_equalTo(_mouthNumberL);
    
        
    }];
    _dataL.textColor = ZITI;
    _dataL.text = @"还款日期: 8月15号";
    _dataL.font = [UIFont fontWithName:ZIXING size:11 * AUTO_HEIGHT];
    
    
    hengLine = [UIView new];
    [self.contentView addSubview:hengLine];
    [hengLine mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_backView);
        make.left.mas_equalTo(_mouthYuanQuanL.mas_right).offset(0);
        make.right.mas_equalTo(_backView.mas_left);
        make.height.mas_equalTo(1);
        
    }];
    hengLine.backgroundColor = [UIColor blackColor];
    
    
    
    
}


- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
